Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: should_add_reactions returning true for Button menu #33

Merged
merged 4 commits into from
Feb 18, 2022

Conversation

DenverCoder1
Copy link
Collaborator

@DenverCoder1 DenverCoder1 commented Feb 18, 2022

Problem:

should_add_reactions is returning true for MenuPages when there are no reactions. This makes it check for reactions permissions when it does not need to.

Solution:

  • MenuPages.should_add_reactions_or_buttons() now uses the implementation of Menu by returning self.should_add_reactions() or self.should_add_buttons().
  • MenuPages.should_add_reactions() and MenuPages.should_add_buttons() now call their respective super() implementations in addition to checking if paginating.
  • In ButtonMenuPages, should_add_buttons() is overridden to only check if the source is paginating since buttons are added in the constructor and should_add_buttons() is checked in the constructor before the buttons are added.

@DenverCoder1 DenverCoder1 changed the title fix: should_add_reactions returning true for MenuPages fix: should_add_reactions returning true for Button menu Feb 18, 2022
@DenverCoder1 DenverCoder1 marked this pull request as draft February 18, 2022 18:55
@DenverCoder1 DenverCoder1 marked this pull request as ready for review February 18, 2022 19:28
@DenverCoder1 DenverCoder1 merged commit 10a1d4d into nextcord:master Feb 18, 2022
@DenverCoder1 DenverCoder1 deleted the fix-should-add-reactions branch February 18, 2022 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants